package com.sep.team4;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

import com.sep.team4.ec.EcActivity;
import com.sep.team4.grades.SemesterActivity;
import com.sep.team4.recentGrade.RecentGradeActivity;

/**
 * This is the mainscreen with the tabs. It will hold the main application
 * It will show tabs
 * @author Gert-Jan
 *  
 */
public class MainTab extends TabActivity{
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view_main_default);

		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec spec; // Reusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Create an Intent to launch an Activity for the tab (to be reused)
		intent = new Intent().setClass(this, RecentGradeActivity.class);
		// Initialize a TabSpec for each tab and add it to the TabHost
		spec = tabHost.newTabSpec("recentGrade")
				.setIndicator("Recent grades")
				.setContent(intent);
		tabHost.addTab(spec);

		// Do the same for the other tabs
		intent = new Intent().setClass(this, SemesterActivity.class);
		spec = tabHost
				.newTabSpec("semester")
				.setIndicator("Semester")
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, EcActivity.class);
		spec = tabHost
				.newTabSpec("ec")
				.setIndicator("EC")
				.setContent(intent);
		tabHost.addTab(spec);


		tabHost.setCurrentTab(1);
	}
}